package com.ecommerce.dal.entity;
// Generated May 3, 2013 3:35:49 PM by Hibernate Tools 3.6.0

import java.util.Date;
import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * ClientHistory generated by hbm2java
 */
@Entity
@Table(name = "client_history")
public class ClientHistory implements java.io.Serializable {

	private ClientHistoryId id;
	private Client client;
	private double paymentAmount;
	private Date currentPaymentDate;
	private Date nextPaymentDate;

	public ClientHistory() {
	}

	public ClientHistory(ClientHistoryId id, Client client,
			double paymentAmount, Date currentPaymentDate) {
		this.id = id;
		this.client = client;
		this.paymentAmount = paymentAmount;
		this.currentPaymentDate = currentPaymentDate;
	}

	public ClientHistory(ClientHistoryId id, Client client,
			double paymentAmount, Date currentPaymentDate, Date nextPaymentDate) {
		this.id = id;
		this.client = client;
		this.paymentAmount = paymentAmount;
		this.currentPaymentDate = currentPaymentDate;
		this.nextPaymentDate = nextPaymentDate;
	}

	@EmbeddedId
	@AttributeOverrides({
			@AttributeOverride(name = "clientHistoryId", column = @Column(name = "CLIENT_HISTORY_ID", nullable = false)),
			@AttributeOverride(name = "clientId", column = @Column(name = "CLIENT_ID", nullable = false)) })
	public ClientHistoryId getId() {
		return this.id;
	}

	public void setId(ClientHistoryId id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "CLIENT_ID", nullable = false, insertable = false, updatable = false)
	public Client getClient() {
		return this.client;
	}

	public void setClient(Client client) {
		this.client = client;
	}

	@Column(name = "PAYMENT_AMOUNT", nullable = false, precision = 22, scale = 0)
	public double getPaymentAmount() {
		return this.paymentAmount;
	}

	public void setPaymentAmount(double paymentAmount) {
		this.paymentAmount = paymentAmount;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "CURRENT_PAYMENT_DATE", nullable = false, length = 19)
	public Date getCurrentPaymentDate() {
		return this.currentPaymentDate;
	}

	public void setCurrentPaymentDate(Date currentPaymentDate) {
		this.currentPaymentDate = currentPaymentDate;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "NEXT_PAYMENT_DATE", length = 19)
	public Date getNextPaymentDate() {
		return this.nextPaymentDate;
	}

	public void setNextPaymentDate(Date nextPaymentDate) {
		this.nextPaymentDate = nextPaymentDate;
	}

}
